package com.example.seckill.service;

import com.alibaba.fastjson.JSONObject;
import com.example.seckill.entity.Product;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author Ding
 * @since 2022-04-25
 */
public interface IProductService extends IService<Product> {

    /**
     * 执行秒杀商品
     * @param uid 用户id
     * @param productId 商品id
     * @return 返回码（-4~1）
     */
    int doSecKill(Integer uid,String productId);

    /**
     * 获取秒杀商品列表
     * @return
     */
    List<Map<String,Object>> getSeckillList();

    boolean toAddItem(String productId);

    boolean beginKill(String productId, Integer num, String time);

    boolean endKill(String productId);
}
